<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.6.8/css/layui.min.css"   />
        <script src="https://cdn.staticfile.org/layui/2.6.8/layui.min.js" ></script>
        <script src="../../res/js/mz.form.js"></script>
        <script src="../../res/js/mz.common.js"></script>
    </head>
    <body>

        <div style=" margin: 10px auto;">
            <form id="data_form" class="layui-form layui-form-pane">

            </form>
        </div>


        <script>

            var field_setting = [
                {title: '编号', name: 'id', type: 'text'},
                {title: '命令', name: 'cmd', type: 'textarea'}
            ];

            field_setting.push({type: 'buttons', name: 'submit'});

            var id = getQueryString('id');

            var mzForm = new MZForm({
                id: 'data_form',
                elements: field_setting,
                data_url: id ? (base_url + '/cmd_one/' + id) : null,
                submit:{
                    post_url: base_url + '/cmd_update',
                    put_url: base_url + '/cmd_put',
                    success_url: 'list.html'
                }
            });



            mzForm.bind('submit', function(data){

            })


        </script>

    </body>
</html>
